//
//  YWNoticeManager.h
//  maintain
//
//  Created by Kyo on 16/3/4.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "YWSingleton.h"
#import "YWNotice.h"

static NSString *const KRefreshPostYWNoticeNotification = @"KRefreshPostYWNoticeNotification";
static NSString *const KRefreshDeleteYWNoticeNotification = @"KRefreshDeleteYWNoticeNotification";
static NSString *const KRefreshModifyYWNoticeNotification = @"KRefreshModifyYWNoticeNotification";

@interface YWNoticeManager : NSObject
YWSingletonH(Manager)

/**
 *  保存公告
 *
 *  @param notices 公告模型数组
 *
 *  @return 结果
 */
- (BOOL)updateNoticeWithNoticeArray:(NSArray*)notices;

/**
 *  获取公告
 *
 *  @param noticeType 公告的类型（我发的还是别人发的）
 *  @param page 刷新页数
 *
 *  @return 结果
 */
- (NSArray*)noticesOfTypeWithMeOrOthers:(YWNoticeType)noticeType page:(NSInteger)page;
/**
 *  获取公告
 *
 *  @param noticeId 公告id
 *
 *  @return 结果
 */
- (YWNotice*)noticeWithNoticeId:(NSInteger)noticeId;
/**
 *  是否存在公告
 *
 *  @param noticeId 公告id
 *
 *  @return 结果
 */
- (BOOL)existNoticeWithNoticeId:(NSInteger)noticeId;
/**
 *  删除公告
 *
 *  @param noticeId 公告id
 *
 *  @return 结果
 */
- (BOOL)deleteNoticeWithNoticeId:(NSInteger)noticeId;
/**
 *  删除公告的图片（修改通知时）
 *
 *  @param noticeId 公告id
 *
 *  @return 结果
 */
- (BOOL)deletePictureOfNoticeWithNoticeId:(NSInteger)noticeId;

/**
 *  请求公告
 *
 *  @param page 分页
 *  @param pageSize 分页size
 *
 *  @return 无
 */
- (void)requestNoticeListWithPage:(NSInteger)page pageSize:(NSInteger)pageSize withComplete:(void(^)(BOOL success))complete;

/**
 *  发布公告
 *
 *  @param title 标题
 *  @param contnet 内容
 *  @param departments 部门
 *  @param pistures图片
 *
 *  @return 无
 */
- (void)postNoticeWithTitle:(NSString*)title contnet:(NSString*)content departments:(NSArray*)departments pistures:(NSArray*)pictures WithComplete:(void(^)(BOOL success))complete;
/**
 *  修改公告
 *
 *  @param notice 公告
 *  @param needUploadPic
 *  @param uploadedPic
 *
 *  @return 结果
 */
- (void)modifyNoticeWithNotice:(YWNotice *)notice needUploadPic:(NSArray*)needUploadPic uploadedPic:(NSArray*)uploadedPic WithComplete:(void(^)(BOOL success))complete;

/**
 *  请求删除公告
 *
 *  @param noticeId 公告id
 *
 *  @return 结果
 */
- (void)requestDeleteNotice:(NSInteger)noticeId complete:(void(^)(BOOL success))complete;
@end
